package com.googlecode.adaboost.classifier;

import com.googlecode.adaboost.trainer.DataElement;

public abstract class RealWeakClassifier implements WeakClassifier {

	/*
	 * The Trainer will set this value
	 */
	protected double cplus;

	/*
	 * The Trainer will set this value
	 */
	protected double cminus;

	public final void setCplus(double cplus) {
		this.cplus = cplus;
	}

	public final void setCminus(double cminus) {
		this.cminus = cminus;
	}

	public final double getCplus() {
		return cplus;
	}

	public final double getCminus() {
		return cminus;
	}

	@Override
	public final double getRate(DataElement data) {
		return (makeDecision(data) == 1 ? cplus : cminus);
	}

}
